<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<?xml-stylesheet href="http://cptsalek.twoday.net/rss2html.xsl" type="text/xsl"?>
<rdf:RDF 
  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
  xmlns:dc="http://purl.org/dc/elements/1.1/"
  xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
  xmlns:cc="http://web.resource.org/cc/"
  xmlns="http://purl.org/rss/1.0/"
> 

  <channel rdf:about="http://cptsalek.twoday.net/">
    <title>Captains Log (Heidentum, IT, Mittelalter, Rollenspiel, Gesellschaft, Politik und der alltägliche Wahnsinn: Tagebuch meines Lebens.) : Rubrik:Lua</title>
    <link>http://cptsalek.twoday.net/</link>
    <description>Heidentum, IT, Mittelalter, Rollenspiel, Gesellschaft, Politik und der alltägliche Wahnsinn: Tagebuch meines Lebens.</description>
    <dc:publisher>cptsalek</dc:publisher>
    <dc:creator>cptsalek</dc:creator>
    <dc:date>2008-04-10T14:59:36Z</dc:date>
    <dc:language>en</dc:language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <sy:updateBase>2000-01-01T00:00:00Z</sy:updateBase>
    <cc:license rdf:resource="http://creativecommons.org/licenses/by/2.0/de/" />

    <image rdf:resource="http://static.twoday.net/cptsalek/images/icon.jpg" />
    <items>
      <rdf:Seq>
            <rdf:li rdf:resource="http://cptsalek.twoday.net/stories/4853708/" />
            <rdf:li rdf:resource="http://cptsalek.twoday.net/stories/4852415/" />

      </rdf:Seq>
    </items>
  </channel>

  <image rdf:about="http://static.twoday.net/cptsalek/images/icon.jpg">
    <title>Captains Log</title>
    <url>http://static.twoday.net/cptsalek/images/icon.jpg</url>
    <link>http://cptsalek.twoday.net/</link>
  </image>

  <item rdf:about="http://cptsalek.twoday.net/stories/4853708/">
    <title>Errata for &quot;Compiling lua-5.1 on Solaris&quot;</title>
    <link>http://cptsalek.twoday.net/stories/4853708/</link>
    <description>Please note that there&apos;s an error in the article &lt;a href=&quot;http://cptsalek.twoday.net/stories/4852415/&quot;&gt;Compiling lua-5.1 on Solaris&lt;/a&gt; I wrote this morning: In the ./src/Makefile the statement ${MYCFLAGS} has to remain untouched, otherwise lua will lack some functionality (such as io.popen).&lt;br /&gt;
I fixed the error in the article but thought I let you know anyway, for all you feedreaders who might miss this change.</description>
    <dc:creator>cptsalek</dc:creator>
    <dc:subject>&lt;a href=&quot;http://cptsalek.twoday.net/topics/Lua&quot;&gt;Lua&lt;/a&gt;</dc:subject>
    <dc:rights>Copyright &#169; 2008 cptsalek</dc:rights>
    <dc:date>2008-04-10T14:54:00Z</dc:date>
  </item>
  <item rdf:about="http://cptsalek.twoday.net/stories/4852415/">
    <title>Compiling lua-5.1 on Solaris</title>
    <link>http://cptsalek.twoday.net/stories/4852415/</link>
    <description>I just compiled Lua-5.1.3 on Solaris 10/Sparc. It&apos;s not that difficult because Lua has been written entirely in ANSI C. The first problem I encountered was the compiler being used, /usr/sfw/bin/gcc. The machine didn&apos;t have another one. The compliation process failed while trying to build the lua executable and complained about something wrong in the systems header files:

&lt;pre&gt;&lt;code&gt;
ranlib liblua.a
gcc -O2 -Wall -DLUA_USE_POSIX -DLUA_USE_DLOPEN   -c -o lua.o lua.c
In file included from /usr/include/sys/signal.h:34,
                 from /usr/include/signal.h:26,
                 from lua.c:8:
/usr/include/sys/siginfo.h:259: error: parse error before &quot;ctid_t&quot;
/usr/include/sys/siginfo.h:292: error: parse error before &apos;}&apos; token
/usr/include/sys/siginfo.h:294: error: parse error before &apos;}&apos; token
/usr/include/sys/siginfo.h:390: error: parse error before &quot;ctid_t&quot;
/usr/include/sys/siginfo.h:392: error: conflicting types for `__proc&apos;
/usr/include/sys/siginfo.h:261: error: previous declaration of `__proc&apos;
/usr/include/sys/siginfo.h:398: error: conflicting types for `__fault&apos;
/usr/include/sys/siginfo.h:267: error: previous declaration of `__fault&apos;
/usr/include/sys/siginfo.h:404: error: conflicting types for `__file&apos;
/usr/include/sys/siginfo.h:273: error: previous declaration of `__file&apos;
/usr/include/sys/siginfo.h:420: error: conflicting types for `__prof&apos;
/usr/include/sys/siginfo.h:287: error: previous declaration of `__prof&apos;
/usr/include/sys/siginfo.h:424: error: conflicting types for `__rctl&apos;
/usr/include/sys/siginfo.h:291: error: previous declaration of `__rctl&apos;
/usr/include/sys/siginfo.h:426: error: parse error before &apos;}&apos; token
/usr/include/sys/siginfo.h:428: error: parse error before &apos;}&apos; token
/usr/include/sys/siginfo.h:432: error: parse error before &quot;k_siginfo_t&quot;
/usr/include/sys/siginfo.h:437: error: parse error before &apos;}&apos; token
In file included from /usr/include/signal.h:26,
                 from lua.c:8:
/usr/include/sys/signal.h:85: error: parse error before &quot;siginfo_t&quot;
In file included from lua.c:8:
/usr/include/signal.h:111: error: parse error before &quot;siginfo_t&quot;
/usr/include/signal.h:113: error: parse error before &quot;siginfo_t&quot;
make[2]: *** [lua.o] Error 1
make[2]: Leaving directory `/opt/gad/sources/lua-5.1.3/src&apos;
make[1]: *** [solaris] Error 2
make[1]: Leaving directory `/opt/gad/sources/lua-5.1.3/src&apos;
make: *** [solaris] Error 2
&lt;/code&gt;&lt;/pre&gt;

I changed the Makefile in &lt;span style=&quot;font-family:Courier,Helvetica&quot;&gt;./src/Makefile&lt;/span&gt; to use Suns own compiler located in &lt;span style=&quot;font-family:Courier,Helvetica&quot;&gt;/opt/SUNWspro/bin/cc&lt;/span&gt;.&lt;br /&gt;BTW: If you never tried Sun Studio just give it a try, I can really recommend it! (Unless you have some crappy OSS package that relies on gcc.)&lt;br /&gt; &lt;br /&gt;After this the compile itself was fine, but I had trouble installing the files. According to the error message Solaris&apos; install can&apos;t handle several files at once:

&lt;pre&gt;&lt;code&gt;
cd src &amp;&amp; install -p -m 0755 lua luac /usr/ucb/bin
usage: install [options] file [dir1 ...]
make: *** [install] Error 2
&lt;/code&gt;&lt;/pre&gt;

Well, there&apos;s an easy solution here, too: There are two installs available, one in /usr/sbin, and the other one being the BSD compatible in /usr/ucb. The last one nearly works, all you have to do is to remove the -p flag given in the install:-section of the top level Makefile.
&lt;br /&gt; &lt;br /&gt;
Here are the changes I made to both Makefiles contained in the package. I used &lt;span style=&quot;font-family:Courier,Helvetica&quot;&gt;diff -c&lt;/span&gt; to create them. The first block is the original package, the second block lists my changes, given in the context they appear:

&lt;pre&gt;&lt;code&gt;
# diff -c lua-5.1.3/Makefile lua-5.1.3-solaris/Makefile
*** lua-5.1.3/Makefile  Thu Jan 17 18:53:37 2008
--- lua-5.1.3-solaris/Makefile  Thu Apr 10 09:14:31 2008
***************
*** 23,33 ****
  # How to install. If you don&apos;t have &quot;install&quot; (unlikely) then get install-sh at
  #     http : / / dev.w3.org/cvsweb/libwww/config/install-sh
  # or use cp instead.
! INSTALL_EXEC= $(INSTALL) -p -m 0755
! INSTALL_DATA= $(INSTALL) -p -m 0644

  # Utilities.
! INSTALL= install
  MKDIR= mkdir

  # == END OF USER SETTINGS. NO NEED TO CHANGE ANYTHING BELOW THIS LINE =========
--- 23,33 ----
  # How to install. If you don&apos;t have &quot;install&quot; (unlikely) then get install-sh at
  #     http : / / dev.w3.org/cvsweb/libwww/config/install-sh
  # or use cp instead.
! INSTALL_EXEC= $(INSTALL) -m 0755
! INSTALL_DATA= $(INSTALL) -m 0644

  # Utilities.
! INSTALL= /usr/ucb/install
  MKDIR= mkdir

  # == END OF USER SETTINGS. NO NEED TO CHANGE ANYTHING BELOW THIS LINE =========
&lt;/code&gt;&lt;/pre&gt;

And this is for ./src/Makefile:

&lt;pre&gt;&lt;code&gt;
# diff -c lua-5.1.3/src/Makefile lua-5.1.3-solaris/src/Makefile
*** lua-5.1.3/src/Makefile      Sat Jan 19 20:37:58 2008
--- lua-5.1.3-solaris/src/Makefile      Thu Apr 10 09:08:11 2008
***************
*** 7,14 ****
  # Your platform. See PLATS for possible values.
  PLAT= none

! CC= gcc
! CFLAGS= -O2 -Wall $(MYCFLAGS)
  AR= ar rcu
  RANLIB= ranlib
  RM= rm -f
--- 7,14 ----
  # Your platform. See PLATS for possible values.
  PLAT= none

! CC= /opt/SUNWspro/bin/cc
! CFLAGS= -xtarget=ultra3 -xarch=v8 -xO3 $(MYCFLAGS)
  AR= ar rcu
  RANLIB= ranlib
  RM= rm -f
&lt;/code&gt;&lt;/pre&gt;

Please note that you might be interested in changing CFLAGS to something specific for your environment, especially if you&apos;re compiling for amd64/x86 (-xtarget=opteron). The settings I used should work on most modern Sun HW, e.g. everything with a UltraSparcIII CPU or newer. -xarch=v8 creates a 32 Bit binary without much optimization in regard of the CPUs chipset.&lt;br /&gt; &lt;br /&gt;&lt;b&gt;Edit:&lt;/b&gt; And here&apos;s the standard diff, for those of you how don&apos;t like the format used above:

&lt;pre&gt;&lt;code&gt;
# diff lua-5.1.3/Makefile lua-5.1.3-solaris/Makefile
26,27c26,27
&amp;lt; INSTALL_EXEC= $(INSTALL) -p -m 0755
&lt; INSTALL_DATA= $(INSTALL) -p -m 0644
---
&gt; INSTALL_EXEC= $(INSTALL) -m 0755
&amp;gt; INSTALL_DATA= $(INSTALL) -m 0644
30c30
&lt; INSTALL= install
---
&gt; INSTALL= /usr/ucb/install
# diff lua-5.1.3/src/Makefile lua-5.1.3-solaris/src/Makefile
10,11c10,11
&amp;lt; CC= gcc
&lt; CFLAGS= -O2 -Wall $(MYCFLAGS)
---
&gt; CC= cc
&amp;gt; CFLAGS= -xtarget=ultra3 -xarch=v8 -xO3 $(MYCFLAGS)
&lt;/code&gt;&lt;/pre&gt;

Please note that again, lua-5.1.3-solaris is the directory containing the source tree with my changes.
&lt;br /&gt; &lt;br /&gt;&lt;b&gt;Errata: &lt;/b&gt;I accidentaly removed the $MYCFLAGS statement from CFLAGS in the original ./src/Makefile. This disables several features which are required for Lua to work. Make sure you leave ${MYCFLAGS} intact!</description>
    <dc:creator>cptsalek</dc:creator>
    <dc:subject>&lt;a href=&quot;http://cptsalek.twoday.net/topics/Lua&quot;&gt;Lua&lt;/a&gt;</dc:subject>
    <dc:rights>Copyright &#169; 2008 cptsalek</dc:rights>
    <dc:date>2008-04-10T07:15:00Z</dc:date>
  </item>


<textinput rdf:about="http://cptsalek.twoday.net/search">
   <title>find</title>
   <description>Search this site:</description>
   <name>q</name>
   <link>http://cptsalek.twoday.net/search</link>
</textinput>
<cc:License rdf:about="http://creativecommons.org/licenses/by/2.0/de/">
   <permits rdf:resource="http://web.resource.org/cc/Reproduction" />
   <permits rdf:resource="http://web.resource.org/cc/Distribution" />
   <requires rdf:resource="http://web.resource.org/cc/Notice" />
   <requires rdf:resource="http://web.resource.org/cc/Attribution" />
   <permits rdf:resource="http://web.resource.org/cc/DerivativeWorks" />
</cc:License>

</rdf:RDF>
