ソースを参照

LibM LibC: add fixes for Lua port.

Mustafa Ali CAN 6 年 前
コミット
3ffb2ad4e0
4 ファイル変更41 行追加1 行削除
  1. 2 0
      LibC/stdio.h
  2. 25 0
      LibM/math.cpp
  3. 8 0
      LibM/math.h
  4. 6 1
      Ports/lua/lua.sh

+ 2 - 0
LibC/stdio.h

@@ -22,6 +22,8 @@ __BEGIN_DECLS
 #define _IOLBF 1
 #define _IONBF 2
 
+#define L_tmpnam 256
+
 struct __STDIO_FILE {
     int fd;
     int eof;

+ 25 - 0
LibM/math.cpp

@@ -95,5 +95,30 @@ double fabs(double value)
 {
     return value < 0 ? -value : value;
 }
+double log2(double )
+{
+    ASSERT_NOT_REACHED();
+}
+
+float log2f(float ){
+    ASSERT_NOT_REACHED();
+
+}
+
+long double log2l(long double ){
+    ASSERT_NOT_REACHED();
+}
 
+double frexp(double , int *){
+    ASSERT_NOT_REACHED();
+}
+
+float frexpf(float , int *){
+    ASSERT_NOT_REACHED();
+}
+
+long double frexpl(long double , int *){
+    ASSERT_NOT_REACHED();
+
+}
 }

+ 8 - 0
LibM/math.h

@@ -53,4 +53,12 @@ float ldexpf(float, int exp);
 
 double pow(double x, double y);
 
+double log2(double);
+float log2f(float);
+long double log2l(long double);     
+double frexp(double, int *);
+float frexpf(float, int *);
+long double frexpl(long double, int *);
+
+
 __END_DECLS

+ 6 - 1
Ports/lua/lua.sh

@@ -1,11 +1,16 @@
 #!/bin/sh
 PORT_DIR=lua
 MAKEOPTS='generic'
+
+INSTALLOPTS="INSTALL_TOP=$SERENITY_ROOT/Root/"
+
 function fetch() {
     run_fetch_web "http://www.lua.org/ftp/lua-5.3.5.tar.gz"
     run_patch lua.patch -p1
 }
-
+function configure() {
+    run_export_env CC i686-pc-serenity-gcc
+}
 function run_make() {
     run_command make $MAKEOPTS "$@"
 }