Skip to content

Instantly share code, notes, and snippets.

@capflam
Created October 4, 2013 18:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save capflam/6830184 to your computer and use it in GitHub Desktop.
Save capflam/6830184 to your computer and use it in GitHub Desktop.
diff --git a/src/mime_type_c.erl b/src/mime_type_c.erl
index 400aace..e40a708 100644
--- a/src/mime_type_c.erl
+++ b/src/mime_type_c.erl
@@ -60,11 +60,10 @@ generate(ModFile, GInfo, SInfoMap) ->
%% "The pattern 'false' can never match the type 'true'"
Inc = case yaws_generated:is_local_install() of
true ->
- Info = ?MODULE:module_info(compile),
- SrcDir = filename:dirname(
- proplists:get_value(source, Info)
- ),
- F = filename:join([SrcDir, "../include/yaws.hrl"]),
+ IncDir = yaws:get_inc_dir(),
+ F = filename:absname(
+ filename:join([IncDir, "yaws.hrl"])
+ ),
"-include(\""++F++"\").";
_ ->
"-include_lib(\"yaws/include/yaws.hrl\")."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment