Commits

Denis Bilenko committed 11ce9c9

fix setup.py to use "--libevent DIR" instead of just "DIR"

- the latter could be belong to another option and should not be touched

Comments (0)

Files changed (1)

     -1      prefer libevent1
     -2      prefer libevent2
 
-Alternatively,
+Also,
 
-    setup.py build DIR
+    setup.py build --libevent DIR
 
 is a shortcut for
 
         LIBEVENT_MAJOR = 1
     elif arg == '-2':
         LIBEVENT_MAJOR = 2
+    elif arg == '--libevent':
+        del sys.argv[i]
+        libevent_source_path = sys.argv[i]
+        add_include_dir(join(libevent_source_path, 'include'), must_exist=False)
+        add_include_dir(libevent_source_path, must_exist=False)
+        add_library_dir(join(libevent_source_path, '.libs'), must_exist=False)
     else:
         i = i+1
         continue
     del sys.argv[i]
 
-if len(sys.argv)>=3 and isdir(sys.argv[-1]):
-    libevent_source_path = sys.argv[-1]
-    del sys.argv[-1]
-    add_include_dir(join(libevent_source_path, 'include'), must_exist=False)
-    add_include_dir(libevent_source_path, must_exist=False)
-    add_library_dir(join(libevent_source_path, '.libs'), must_exist=False)
-
 
 if not sys.argv[1:] or '-h' in sys.argv or '--help' in sys.argv:
     print __doc__
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.