diff --git a/scripts/generate_header.sh b/scripts/generate_header.sh index 0856c46d..94807472 100755 --- a/scripts/generate_header.sh +++ b/scripts/generate_header.sh @@ -35,7 +35,7 @@ sym_regex='^LUA\(LIB\)\?_API\s\+\([^(]\+\)\s*(\([^)]\+\))\s\+(\([^)]\+\));' # get funcptr declarations ptrize() { - grep '^LUA' | grep -v "$IGNORE_SYM" | sed -e "s/$sym_regex/static \2(*\3) (\4);/" + grep '^LUA' | grep -v "$IGNORE_SYM" | sed -e "s/$sym_regex/static\t\2(*\3)\t(\4);/" } import_sym() { @@ -66,9 +66,6 @@ decl_export() { uncomment $1 | onelineize | export_sym } -print_self() { - cat "$0" | sed -e 's#^#// #' -} generate_header() { local LUA_PATH="$1" @@ -85,13 +82,14 @@ generate_header() { echo "}" echo "In linux, to compile this file, you'd do: 'gcc -o xxxxx.so -shared xxxxx.c'. Simple!" echo "Due to the way the API is structured, you *should not* link or include lua libraries." - echo "This file was automatically generated by the below code. DO NOT MODIFY DIRECTLY." + echo "This file was automatically generated. DO NOT MODIFY DIRECTLY." echo "**/" echo - print_self echo echo "#include " echo "#include // for BUFSIZ? this is kinda weird" + echo + echo cat "$LUA_PATH/luaconf.h" decl "$LUA_PATH/lua.h" @@ -119,7 +117,6 @@ generate_api_require() { echo "This file is automatically generated. DO NOT MODIFY." echo "**/" echo - print_self echo echo "#include " echo "#include "