ext/extconf.rb in ferocia-rubywmq-1.1.0 vs ext/extconf.rb in ferocia-rubywmq-1.1.1

- old
+ new

@@ -12,33 +12,41 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. ################################################################################ -require 'mkmf' -require_relative 'generate/generate_reason' -require_relative 'generate/generate_const' -require_relative 'generate/generate_structs' - -include_path = '' -if RUBY_PLATFORM =~ /mswin32/ - include_path = 'C:\Program Files\IBM\WebSphere MQ\Tools\c\include' - dir_config('mqm', include_path, '.') +if RUBY_PLATFORM =~ /darwin/ + # do nothing on a mac, this is so people developing applications using this + # gem on a mac (using stubs for development) can still keep the gem in their + # Gemfile + # create a blank Makefile to satisfy extension install requirements + File.open("Makefile", "w") { |f| f << 'install:' } else - include_path = '/opt/mqm/inc' - #dir_config('mqm', include_path, '/opt/mqm/lib') -end + require 'mkmf' + require_relative 'generate/generate_reason' + require_relative 'generate/generate_const' + require_relative 'generate/generate_structs' -have_header('cmqc.h') + include_path = '' + if RUBY_PLATFORM =~ /mswin32/ + include_path = 'C:\Program Files\IBM\WebSphere MQ\Tools\c\include' + dir_config('mqm', include_path, '.') + else + include_path = '/opt/mqm/inc' + #dir_config('mqm', include_path, '/opt/mqm/lib') + end -# Check for WebSphere MQ Server library -unless (RUBY_PLATFORM =~ /win/i) || (RUBY_PLATFORM =~ /solaris/i) || (RUBY_PLATFORM =~ /linux/i) - have_library('mqm') -end + have_header('cmqc.h') -# Generate Source Files -GenerateReason.generate(include_path+'/') -GenerateConst.generate(include_path+'/', 'lib') -GenerateStructs.new(include_path+'/', 'generate').generate + # Check for WebSphere MQ Server library + unless (RUBY_PLATFORM =~ /win/i) || (RUBY_PLATFORM =~ /solaris/i) || (RUBY_PLATFORM =~ /linux/i) + have_library('mqm') + end -# Generate Makefile -create_makefile('wmq/wmq') + # Generate Source Files + GenerateReason.generate(include_path+'/') + GenerateConst.generate(include_path+'/', 'lib') + GenerateStructs.new(include_path+'/', 'generate').generate + + # Generate Makefile + create_makefile('wmq/wmq') +end